package com.atwisdom.star.core.bsl.customized;

import com.alibaba.fastjson.JSONObject;
import com.atwisdom.star.core.dao.pojo.modelClass.hier.HierInstance;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 
 * @Date: 2023-08-28 10:54
 */
public interface StockBslService {
    JSONObject predicateBoard(JSONObject dataJson);

    List<JSONObject> queryByBinId(JSONObject dataJson);

    /**
     * 通过bcode与quantity，确定可以出库的记录
     * @param dataJson  主要参数有两个， 分别是 material_bcode， quantity
     */
    List<JSONObject> queryAvailableStockDetail(JSONObject dataJson);
    public List<JSONObject> queryAvailableStockDetailCodeNum(JSONObject paramJson);
    List<JSONObject> createSortingOrder(JSONObject dataJson);

    List<JSONObject> queryForceStockDetail(JSONObject dataJson);

    
    void inBound(JSONObject dataJson);

    String fetchStockBatchNumber();

    String fetchStockSubBatchNumber(String batchNumber);

    
    void inBoundToWaster(JSONObject dataJson);

    
    void inBoundToDefective(JSONObject dataJson);

    
    void inBoundToWaitCheck(JSONObject dataJson);

    List<HierInstance> fetchBinListByWarehouseCondition(JSONObject paramJson);

    
    void inBoundWithBatchNumber(JSONObject dataJson);

    
    void inBoundForce(JSONObject dataJson);

    
    List<JSONObject> outBound(JSONObject dataJson);

    
    List<JSONObject> outBoundForce(JSONObject dataJson);

    
    void inBoundByReceiptOrder(JSONObject dataJson);

    
    boolean stockCancel(JSONObject dataJson);

    
    void createSurplusAndLoss(JSONObject dataJson);

    
    JSONObject deleteScan(JSONObject paramJson);

   
    JSONObject stockTransferScan(JSONObject paramJson);

    void takeStock(JSONObject dataJson);

    @Transactional(rollbackFor = Exception.class)
    void stockExchange(JSONObject dataJson);

    void stockTransfer(JSONObject dataJson);

    List<JSONObject> outBoundByUniqueCodeList(JSONObject dataJson);

    List<JSONObject> outBoundByUniqueCodeOrKanbanCodeAndQuantity(JSONObject dataJson);

    List<JSONObject> outBoundByIdList(List<Long> stockDetailIdList, Long formId, Integer formType);

    @Transactional(rollbackFor = Exception.class)
    List<JSONObject> inBoundByStockDetail(List<JSONObject> stockDetailList,
                                          Long formId, Integer formType,
                                          String inWarehouseCode, Long inWarehouseId,
                                          String inBinCode, Long inBinId);

    JSONObject queryAvailableByUniqueCode(JSONObject paramJson);

    void freezeBatchNumber(JSONObject dataJson);

    void unFreezeBatchNumber(JSONObject dataJson);

    void batchUpdateStockStatus(JSONObject dataJson);
}
